package services;

import java.sql.SQLException;
import java.util.Set;

import objects.ActorObject;
import objects.CategoryObject;
import objects.EpisodeObject;
import objects.SeasonObject;
import objects.SerialContainer;
import dao.DaoManager;
import dao.DaoSave;
import dao.DbTables;

public class SaveService {

	DaoManager daoMgr = DaoManager.INSTANCE;
	
	DaoSave daoSave = (DaoSave) daoMgr.getDAO(DbTables.SAVE);

	public Set<CategoryObject> getCategoryList() throws SQLException {
		return daoSave.getCategoryList();
	}
	
	public void SaveNewEpisode(SerialContainer serialContainer) throws SQLException {
		daoSave.saveEpisodesToDB(serialContainer);
	}
	
	public void SaveNewEpisode(EpisodeObject epObject, int seasonID) throws SQLException {
		daoSave.saveEpisode(epObject, seasonID);
	}

	public void saveNewSeason(SeasonObject newSeasonObject) throws SQLException {
		daoSave.saveNewSeasonToDB(newSeasonObject);
	}

	public void saveActor(Set<ActorObject> actorList, int serialID) throws SQLException{
		daoSave.saveActor(actorList, serialID);
	}
	
	
	
}
